#ifndef VIDEOINPUT_H
#define VIDEOINPUT_H

/**
 * QMediaCaptureSession set QCamera QVideoSink
 * QCamera set QMediaDevices
 * QCamera set start
 * QVideoSink set QVideoFrame
 * QVideoSink output video frame
 */

#include <QObject>
#include <QCamera>
#include <QMediaCaptureSession>
#include <QMediaDevices>
#include <QVideoSink>
#include <QVideoFrame>

class VideoInput : public QObject
{
    Q_OBJECT

public:
    explicit VideoInput(QObject *parent = nullptr);
    ~VideoInput();

private slots:
    void on_frame_changed(const QVideoFrame &frame); // 一帧视频到来的信号

private:
    QMediaCaptureSession m_captureSession;
    QVideoSink m_videoSink;
    QCamera *m_camera;
};

#endif // VIDEOINPUT_H
